// stores/counter.js
import {
	defineStore
} from 'pinia';



export const sysStore = defineStore('sys', {
	state: () => ({
		systemHeight: 20,
		titleHeight: 40,
		scrollStatus: false
	}),
	// 也可以这样定义
	// state: () => ({ count: 0 })
	actions: {
		getSys() {
			this.systemHeight = (uni.getSystemInfoSync().statusBarHeight || 40);
			return this.systemHeight;
		},
		getTitle() {
			// #ifdef MP-WEIXIN
			// 胶囊按钮信息
			const meunButton = uni.getMenuButtonBoundingClientRect();
			// 手机状态栏高度
			let systemHeight = uni.getSystemInfoSync().statusBarHeight;
			this.titleHeight = ((meunButton.top - systemHeight) * 2 + meunButton.height - 10);
			// #endif
			return this.titleHeight;
		}

	},
});